export function getChildrenByName(routes, name) {
    let result = [];
    for (let i = 0; i < routes.length; i++) {
        const route = routes[i];
        if (route.name === name) {
            result = route.children ? route.children.map((a) => a.name) : [];
            break;
        }

        if (route.children) {
            result = getChildrenByName(route.children, name);
        }
    }
    return result;
}

